#ifndef ENEMYDATABASE_H
#define ENEMYDATABASE_H

#include <map>
#include <string>

#include "EnemyData.h"

class EnemyDatabase
{
public:
    static void initialise(const std::string& saveName);
    static void cleanUp();

    static EnemyDatabase& get();
	
	void addEnemyData(const EnemyData& enemyData, int id);
    	
    const EnemyData& getEnemyData(int id) const;

    void save(std::string saveName);
private:
    EnemyDatabase();

    static EnemyDatabase instance;
	static bool initialised;


    bool readFile(std::string saveName);
    void writeFile(std::string saveName) const;
	//create a map to store the enemy count in relation to enemyData
	typedef std::map<int, EnemyData> enemy_map;
    typedef enemy_map::const_iterator const_enemy_it;
    enemy_map enemies;

};

#define GET_ENEMY_DATA(enemyId) EnemyDatabase::get().getEnemyData(enemyId)

#endif /*ENEMYDATABASE_H*/